<template>
  <el-container class="home-container">
    <!-- 头部区域 -->
    <el-header>
      <div>
        <img style="width: 150px" src="../assets/svg/iaaiscolor.svg" alt="" />
        <!-- <span style="color:gray">必达用户关联系统</span> -->
      </div>
      <el-button type="info">退出</el-button>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside :width="isCollapse ? '64px' : '200px'">
        <div class="toggle-button" @click="toggleCollapse">|||</div>
        <!-- 侧边栏菜单 -->
        <el-menu
          background-color="#d5dce9"
          text-color="black"
          active-text-color="#487ae7"
          :unique-opened="true"
          :collapse="isCollapse"
          :collapse-transition="false"
          :default-active="$route.path"
          :router="true"
        >
          <!-- 文件审批 -->
          <!-- 一级菜单 -->
          <el-submenu index="1">
            <!--一级菜单模板区域 -->
            <template slot="title">
              <!-- 图标 -->
              <i class="el-icon-folder"></i>
              <!-- 文本 -->
              <span>文件审批</span>
            </template>
            <!-- 二级菜单 -->
            <el-menu-item index="/file1">
              <template slot="title">
                <!-- 文本 -->
                <span>待我处理文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file2">
              <template slot="title">
                <!-- 文本 -->
                <span>待他人处理文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file3">
              <template slot="title">
                <!-- 文本 -->
                <span>已处理文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file4">
              <template slot="title">
                <!-- 文本 -->
                <span>已完成文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file5">
              <template slot="title">
                <!-- 文本 -->
                <span>被驳回文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file7">
              <template slot="title">
                <!-- 文本 -->
                <span>已驳回文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/file6">
              <template slot="title">
                <!-- 文本 -->
                <span>抄送文件</span>
              </template>
            </el-menu-item>
            <el-menu-item index="/draftfile">
              <template slot="title">
                <!-- 文本 -->
                <span>文件草稿</span>
              </template>
            </el-menu-item>

            <el-menu-item index="/filesave">
              <template slot="title">
                <!-- 文本 -->
                <span>文件存档</span>
              </template>
            </el-menu-item>
          </el-submenu>

          <!-- 新建审批 -->
          <el-submenu index="2">
            <!--一级菜单模板区域 -->
            <template slot="title">
              <!-- 图标 -->
              <i class="el-icon-folder-add"></i>
              <!-- 文本 -->
              <span>新建审批</span>
            </template>
            <el-menu-item index="/newfile">
              <template slot="title">
                <!-- 文本 -->
                <span>新建审批</span>
              </template>
            </el-menu-item>
          </el-submenu>

          <!-- 真伪查询 -->
          <el-submenu index="3">
            <!--一级菜单模板区域 -->
            <template slot="title">
              <!-- 图标 -->
              <i class="el-icon-document-checked"></i>
              <!-- 文本 -->
              <span>真伪查询</span>
            </template>
              <el-menu-item index="/truth">
              <template slot="title">
                <!-- 文本 -->
                <span>真伪查询</span>
              </template>
            </el-menu-item>
            
          </el-submenu>

        </el-menu>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <!-- 路由占位符 -->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      //是否折叠
      isCollapse: false,
    };
  },
  created() {},
  methods: {
    //点击按钮切换菜单的折叠与展开
    toggleCollapse() {
      this.isCollapse = !this.isCollapse;
    },
  },
};
</script>

<style lang="less" scoped>
.home-container {
  height: 100%;
}
.el-container {
  background-color: #afb5b9;
}

.el-aside {
  background-color: #bbc0c8;
  .el-menu {
    border-right: none;
  }
}

.el-main {
  background-color: #eaedf2;
}
.el-header {
  background-color: rgb(254, 254, 254);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 20px;
  > div {
    display: flex;
    align-items: center;
    margin-left: 15rpx;
  }
}
.toggle-button {
  background-color: #707a88;
  font-size: 10px;
  line-height: 24px;
  color: #fff;
  text-align: center;
  // letter-spacing: 0.2em;
  cursor: pointer;
}
</style>